home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
cool
/
ge_cool.lha
/
GE_COOL2.1
/
src
/
Matrix
/
Base_M_Vector.C
next >
Wrap
C/C++ Source or Header
|
1992-07-01
|
3KB
|
87 lines
//
// Copyright (C) 1992 General Electric Company
//
// Permission is granted to any individual or institution to use, copy, modify,
// and distribute this software, provided that this complete copyright and
// permission notice is maintained, intact, in all copies and supporting
// documentation.
//
// General Electric Company provides this software "as is" without
// express or implied warranty.
//
// Updated: VDN 02/21/92 -- New lite version
//
#ifndef BASE_M_VECTORH // If no CoolM_Vector class,
#include <cool/Base_M_Vector.h> // Include header file
#endif
// CoolM_Vector -- Constructor specifiying size of vector
// Input: length
// Output: None
CoolM_Vector::CoolM_Vector (unsigned int elmts) {
#if ERROR_CHECKING
if (elmts <= 0) { // If invalid size specified
//RAISE (Error, SYM(CoolM_Vector), SYM(Invalid_Length),
printf ("CoolM_Vector::CoolM_Vector(): Invalid size %d specified for length.\n", elmts);
abort ();
}
#endif
this->num_elmts = elmts; // Save elmt count
}
// CoolM_Vector -- constructor for reference to another CoolM_Vector object
// Input: CoolM_Vector reference
// Output: None
CoolM_Vector::CoolM_Vector (const CoolM_Vector& m) {
this->num_elmts = m.num_elmts; // Copy elmt count
}
// CoolM_Vector -- Destructor for CoolM_Vector
// Input: None
// Output: None
CoolM_Vector::~CoolM_Vector () {;}
// index_error -- Raise exception for invalid row index.
// Input: function string, type string, index specification
// Output: None
void CoolM_Vector::index_error (const char* fcn, const char* type, int index) const {
//RAISE (Error, SYM(CoolM_Vector), SYM(Invalid_Index),
printf ("CoolM_Vector<%s>::%s: Invalid value %d specified for index.\n",
type, fcn, index);
abort ();
}
// dimension_error -- Raise exception for invalid dimensions
// Input: function string, type string, rowXcol,rowXcol
// Output: None
void CoolM_Vector::dimension_error (const char* fcn, const char* type,
int l1, int l2) const {
//RAISE (Error, SYM(CoolM_Vector), SYM(Invalid_Dim),
printf ("CoolM_Vector<%s>::%s: Dimensions [%d] and [%d] do not match.\n",
type, fcn, l1, l2);
abort ();
}
// va_arg_error -- Raise exception for using class objects, or chars in (...)
// Input: Type string
// Output: None
void CoolM_Vector::va_arg_error (const char* Type, int n) {
//RAISE (Error, SYM(CoolM_Vector), SYM(Invalid_Va_Arg),
printf ("CoolM_Vector<%s>::CoolM_Vector<%s>(): Invalid type in ... or wrong alignment with %d bytes.\n",
Type, Type, n);
abort ();
}